﻿ALTER TABLE `yd_team`
ADD COLUMN `isclose`  int(10) NOT NULL AFTER `gcate`,
ADD COLUMN `clodate`  datetime NOT NULL AFTER `isclose`;



ALTER TABLE `yd_user`
ADD COLUMN `brand`  varchar(100) NULL AFTER `isnew`,
ADD COLUMN `model`  varchar(100) NULL AFTER `brand`,
ADD COLUMN `version`  varchar(100) NULL AFTER `model`,
ADD COLUMN `system`  varchar(100) NULL AFTER `version`,
ADD COLUMN `platform`  varchar(100) NULL AFTER `system`,
ADD COLUMN `sdkversion`  varchar(100) NULL AFTER `platform`;


//----------------已更新 --------------------------

ALTER TABLE `yd_team`
ADD COLUMN `istmnum`  int(10) NOT NULL COMMENT '当竞赛人数达到xx人后向创建者推送消息' AFTER `clodate`;


ALTER TABLE `yd_setting`
ADD COLUMN `name`  varchar(100) NULL AFTER `step3`,
ADD COLUMN `text`  varchar(200) NULL AFTER `name`;

ALTER TABLE `yd_setting`
MODIFY COLUMN `cate`  varchar(10) CHARACTER SET gbk COLLATE gbk_chinese_ci NULL DEFAULT '' COMMENT '数据类别 sys系统 home 首页 self自定义' AFTER `imgtxt`;

ALTER TABLE `yd_setting`
CHANGE COLUMN `text` `text1`  varchar(300) CHARACTER SET gbk COLLATE gbk_chinese_ci NULL DEFAULT NULL AFTER `name`,
ADD COLUMN `text2`  varchar(300) NULL AFTER `text1`,
ADD COLUMN `text3`  varchar(300) NULL AFTER `text2`;


ALTER TABLE `yd_team`
ADD COLUMN `isgf`  int(10) NOT NULL COMMENT '是否官方' AFTER `istmnum`,
ADD COLUMN `zdorder`  int(10) NOT NULL COMMENT '置顶排序' AFTER `isgf`;

ALTER TABLE `yd_data_day`
ADD COLUMN `dkday`  int(10) NOT NULL COMMENT '表示已经联系签到打开了几天' AFTER `date3`;

ALTER TABLE `yd_setting`
ADD COLUMN `textWxRemark`  varchar(255) NULL AFTER `text3`;

ALTER TABLE `yd_team`
ADD COLUMN `isjs`  int(10) NOT NULL DEFAULT 0 COMMENT '是否结束' AFTER `zdorder`;



ALTER TABLE `yd_team`
ADD COLUMN `url`  varchar(200) NULL AFTER `name`;


ALTER TABLE `yd_user`
ADD COLUMN `unionId`  varchar(64) NULL AFTER `isnoyd`;



ALTER TABLE `yd_data_day`
ADD COLUMN `zskb`  int(10) NOT NULL DEFAULT 0 AFTER `dkday`;



//----------------已更新 --------------------------


ALTER TABLE `yd_user`
ADD COLUMN `fxuid`  int(10) NOT NULL  DEFAULT 0  AFTER `unionId`,
ADD COLUMN `fxdate`  datetime NULL AFTER `fxuid`;
ADD COLUMN `fxtime`  datetime NULL AFTER `fxdate`;
ADD COLUMN `credate`  datetime NULL AFTER `fxtime`;
go


INSERT INTO `kqyd`.`yd_admin_config` ( `system`, `group`, `title`, `name`, `value`, `type`, `options`, `url`, `tips`, `sort`, `status`, `ctime`, `mtime`)
 VALUES ( '0', 'xcx', '步数增幅', 'step_add', '0.15', 'input', '', '', '读取的微信步数，全局可配置增幅/减幅百分数。比如读取微信3000步，全局增幅15%，则D几名显示3450步', '0', '1', '1510881214', '1510881214');

 INSERT INTO  `yd_admin_config` (`system`, `group`, `title`, `name`, `value`, `type`, `options`, `url`, `tips`, `sort`, `status`, `ctime`, `mtime`) VALUES ( '0', 'xcx', '分享奖励K币', 'fxjl', '1', 'input', '', '', '每一个新用户奖励n个K币给分享者', '0', '1', '1510881214', '1510881214');

 
   INSERT INTO  `yd_admin_config` (`system`, `group`, `title`, `name`, `value`, `type`, `options`, `url`, `tips`, `sort`, `status`, `ctime`, `mtime`) VALUES ( '0', 'xcx', '10000步计划分享赠送步数', 'fx_step_add', '200', 'input', '', '', '每一个新用户奖励多少步数给分享者', '0', '1', '1510881214', '1510881214');

  INSERT INTO  `yd_admin_config` (`system`, `group`, `title`, `name`, `value`, `type`, `options`, `url`, `tips`, `sort`, `status`, `ctime`, `mtime`) VALUES ( '0', 'xcx', '10000步计划多少步签到成功', 'fxstep_10000', '10000', 'input', '', '', '多少步数可以计入签到', '0', '1', '1510881214', '1510881214');

   INSERT INTO  `yd_admin_config` (`system`, `group`, `title`, `name`, `value`, `type`, `options`, `url`, `tips`, `sort`, `status`, `ctime`, `mtime`) VALUES ( '0', 'xcx', '10000步计划type值,不要改', 'jstype_10000', '10000', 'input', '', '', 'team的jstype的值,表示该team是签到团', '0', '1', '1510881214', '1510881214');

 ALTER TABLE `yd_team`
ADD COLUMN `jstype`  varchar(10) NULL DEFAULT '' COMMENT '竞赛类别' ;

ALTER TABLE `yd_data_qd`
ADD COLUMN `dqqd`  int(10) NULL DEFAULT 0 AFTER `type`,
ADD COLUMN `lxqd`  int(10) NULL DEFAULT 0 AFTER `dqqd`;

ALTER TABLE `yd_user`
ADD COLUMN `fxtype`  varchar(20) NULL DEFAULT '' AFTER `credate`,
ADD COLUMN `fxvalue`  varchar(100) NULL DEFAULT '' AFTER `fxtype`;

ALTER TABLE `yd_data_qd`
CHANGE COLUMN `lxqd` `qdlj`  int(10) NULL DEFAULT 0 AFTER `dqqd`;



ALTER TABLE `yd_data_qd`
ADD COLUMN `lddate`  datetime NULL AFTER `qdlj`;

ALTER TABLE `yd_user`
ADD COLUMN `code`  varchar(100) NULL DEFAULT '' AFTER `fxvalue`;

CREATE TABLE `yd_cardmax` (
`id`  int(10) NOT NULL AUTO_INCREMENT ,
`cardmax`  int(10) NULL ,
`type`  varchar(20) NULL DEFAULT '' ,
PRIMARY KEY (`id`)
)
;


ALTER TABLE `yd_data_qd`
CHANGE COLUMN ` id` `id`  int(10) NOT NULL AUTO_INCREMENT FIRST ;









ALTER TABLE `yd_team_user_his`
ADD COLUMN `fxuid`  int(10) NULL DEFAULT 0 AFTER `type`,
ADD COLUMN `addstep`  int(10) NULL DEFAULT 0 AFTER `fxuid`,
ADD COLUMN `credate`  datetime NULL AFTER `addstep`;


ALTER TABLE `yd_data_js`
ADD COLUMN `credate`  datetime NULL AFTER `second`;
